<template>

  <div class="img" :style="note">

    <div style="width: 350px;height: 922px;background-color: rgba(0,0,0,0.01);margin:0px auto;text-align: center;position: relative">
      <div style="width: 350px;height: 500px;background-color: rgba(0,0,0,0.6);text-align: center;position: absolute;margin-top: 100px">
        <p style="font-size: 28px;font-family: '楷体';padding-top: 20px;color: slategray">添加任务</p>
        <hr style="width: 90%;height: 0.01px"/>
        <div style="margin-top: 20px">
          <div style="margin-top: 40px">
            <el-input v-model="InputName" placeholder="任务的描述" style="width: 70%"></el-input>
            <div class="block"  style="width: 100%;margin-top:30px ">
              <el-date-picker
                style="width:70% "
                v-model="value1"
                type="daterange"
                format="yyyy 年 MM 月 dd 日"
                value-format="yyyy-MM-dd"
                range-separator="至"
                start-placeholder="开始日期"
                end-placeholder="结束日期">
              </el-date-picker>
            </div>

            <!--<el-input type="textarea" :rows="2" placeholder="请简单描述" v-model="textarea" style="width: 70%;margin-top: 30px" ></el-input>-->
          </div>



          <div style="width: 100%">
            <el-button plain style="margin-top: 20px;width: 100px" size="small" @click="register()">立即注册</el-button>
          </div>

        </div>

      </div>

    </div>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        note: {
          backgroundImage: "url(" + require("../assets/img/starrr.jpg") + ")",
          backgroundRepeat: "no-repeat",
          backgroundSize: "1890px 1500px",
        },
        oid:'',
        id:'',
        InputName:'',
        InputNo:'',
        CompanyUser:'',
        textarea: '',
        value1: '',
        value2: ''
      }
    },
    methods: {


      register() {

        var ee=this.value1
        console.log(ee)
        var eee=ee[0]
        console.log(eee)
       var eeee=ee[1]
        console.log(eeee)
        this.oid= this.$route.query.mallCode
          axios.post('/user/publishTask',{
            oid:this.oid,
            startdate:eee,
            finishdate:eeee,
            name:this.InputName

          }).then((response) => {
            if(response.data.states==800){
              this.$notify({
                title: '成功',
                message: '注册成功',
                type: 'success',
                duration:1000
              });
              this.$router.replace({
                path: '/Echart',
                query: {
                  mallCode: this.oid,
                }
              })
            }else{
              this.$notify.error({
                title: '错误',
                message: response.data.message,
                type: 'warning',
                duration:0
              });
            }
          }).catch((response)=>{

          })
        }

      },





  }
</script>

<style scoped>

</style>
